package com.example.InnerClass;

public class Test5Innerclass {
    public static void main(String[] args) {
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("Swimming Done");
            }
        });
    }

    //使用接口方法
    public static void goSwimming(Swimming swimming) {
        /*
         Swimming swimming = new Swimming() {
            @Override
            public void swim() {
                System.out.println("Swimming Done");
            }
        }   运行看子类
        */
        swimming.swim();
    }
}

//游泳接口
interface Swimming {
    void swim();
}
